#include "include\entitymanager.h"
#include <iostream>

EntityManager* EntityManager::pInstance = NULL;

EntityManager::EntityManager()
{
    pPlayer = new Entity("Player");
    pPlayer->SetIsPlayer(true);

#ifdef DEBUG_MODE
    cout << "Creating player\n";
#endif // DEBUG_MODE
}

EntityManager::~EntityManager()
{
    delete pPlayer;
}

EntityManager *EntityManager::GetInstance()
{
    if (pInstance == NULL)
    {
        pInstance = new EntityManager();
    }

    return pInstance;
}

Entity *EntityManager::CreateNewEntity(string name)
{
    Entity *newEntity = new Entity(name);
    #ifdef DEBUG_MODE
    cout << "Creating another entity\n";
    #endif // DEBUG_MODE
    return newEntity;
}
